<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue'
export default {
  components: {
    Chart
  },
  data() {
    return {
      cdata: {
        category: [
          '12-26',
          '12-27',
          '12-28',
          '12-29',
          '12-30',
          '12-31',
          '01-01',
          '01-02',
          '01-03',
          '01-04',
          '01-05',
          '01-06',
          '01-07',
          '01-08',
          '01-09'
          // "01-10",
          // "01-11",
          // "01-12",
          // "01-13",
          // "01-14",
          // "01-15",
          // "01-16",
          // "01-17",
          // "01-18",
          // "01-19",
          // "01-20",
          // "01-21",
          // "01-22",
          // "01-23",
          // "01-24",
          // "01-25",
        ],
        allData: [
          91.4,
          87.8,
          91.4,
          91.4,
          91.4,
          91.4,
          88.8,
          91.4,
          93,
          88.8,
          91.4,
          92.2,
          91.4,
          95,
          91.4
        ],
        perfectData: [
          90.4,
          89,
          90.4,
          90.9,
          90.4,
          90.4,
          88.5,
          90.4,
          92.3,
          88.5,
          90.4,
          92.2,
          91.7,
          94.4,
          90.4
        ],
        rateData: [
          12609,
          11979,
          12651,
          12543,
          12731,
          12622,
          12179,
          12644,
          12939,
          12179,
          12628,
          12696,
          12609,
          13249,
          12612
        ]
      }
    }
  },
  mounted() {
    this.setData()
  },
  methods: {
    // 根据自己的业务情况修改
    setData() {
      for (let i = 0; i < this.cdata.perfectData.length - 1; i++) {
        // let rate = this.cdata.perfectData[i] / this.cdata.allData[i];
        // this.cdata.rateData.push(rate.toFixed(2));
        this.cdata.perfectData[i].toFixed(1)
        this.cdata.allData[i].toFixed(1)
      }
      // console.log(this.cdata);
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
